Skip to main content

Full text of "Syntax Magazine"

See other formats


SYNTAX 


Serving  Timex-Sinclair 
Personal  Computers 


A  PUBLICATION  OF  THE  HARVARD  GROUP 


VOL. 5  NO  .1 


ISSN  0273-2696 


JAN. .  1984 


IN  THIS  ISSUE 


8K  Programs 

Biorhythms . 9 

Kaleidoscope . 19 

Not  Entirely  Clear . 9 

Pi . 18 

Renumber . 14 

Reuseable  Loops . 6 

Classified  Ads . 22 

Dear  Editor . 12 

Games . 9,19 

Hardware  Review 
UM-64  Memory  Module.... 4 

ROMPAK  ROM  Card . 5 

Hardware  Specifications 
2068  Connector  Pinouts. 8 
2068  Port  Assignments .22 

Machine  Code . 14,19 

Math . 18 

New  Products  and 

Services . 3 

News 


Sinclair  Announces  QL..1 
New  Timex  Per ipherals . . 4 
Program  Improvements 


ROM  Calls . 2 

Cassette  Labeler . 2 

Software  Hint 

RAND  and  AutoRUN . 7 

Software  Review 

Timeblasters . 6 

Mazeball . 6 

Syntax  Errors . 2 

Users'  Groups . 2 

Utilities . 6 ,14 

Vendor  Report . 2 


Index  of  Advertisers 
Byte  Back  Co . 17 


SINCLAIR  ANNOUNCES  QL;  PLANS  US  MKT  RE-ENTRY 

Sinclair  Research,  Ltd  announced  in  London  a 
new  machine — the  Sinclair  QL — using  the  68008 
processor  running  at  7.5  MHz.  Late  February 
should  see  initial  shipments  in  the  UK,  with 
production  building  to  20,000/mo  by  summer. 
Introductory  price  in  the  UK  is  $599,  but  the 
US  price  will  likely  be  $499  when  the  machine 
arrives  here,  perhaps  by  fall  of  84.  Specs 
call  for  a  word-processing  quality,  65-key 
keyboard  with  5  keys  for  functions  &  4  cursor 
control  keys.  With  a  monitor,  you'll  get  85 
char,  by  25  lines,  but  only  40-60  characters 
with  TV  display.  Display  outputs  to  both  BW 
RGB  monitors  and  PAL  UHF  TV  characterize  the 
UK  version.  Standard  memory  of  128K  with  two 
improved  microdrives  (100K  each)  plus  bundled 
software  from  Psion  for  word-processing,  data 
base,  spreadsheet  &  graphics  make  a  powerful 
machine.  Although  the  QDOS  operating  system 
&  Sinclair  SuperBASIC  set  the  machine  apart, 
the  multiple-window  feature  and  export/import 
of  files  between  programs  place  this  design 
well  ahead  of  similarly  priced  machines.  Up 
to  6  more  microdrives  &  a  Sinclair  Local  Area 
Network  can  attach  to  this  processor.  Other 
features  include  32K  ROM  with  provision  for 
64K  ROM  cartridges  &  4-color  high-resolution 
(512x256)  screen  or  8-colors  at  256x256  dots, 
2  RS-232C  serial  ports  and  a  realtime  clock. 

Sinclair  SuperBASIC  is  fully  procedure- 
structured  and  extendable.  Execution  speed 
does  not  depend  on  program  size. 

Thorn-EMI  produces  the  QL.  Sinclair 
plans  to  distribute  in  the  US  by  mail-order. 

SYNTAX  expects  this  machine  to  be  in 
short  supply  since  it  competes  functionally 
with  machines  currently  selling  at  2-3  times 
its  projected  price.  Sinclair  interfaces  for 
parallel  printers,  Winchester  disks,  &  IEEE- 
488,  as  well  as  500K  memories,  will  follow. 

In  other  news,  Micro-Prolog  (a  training 
AI  language)  is  available  for  the  Spectrum. 

See  page  4  for  more  ZX/TS  news  from  CES. 


i 


SYNTAX  ERRORS:  Change  First- 
loader's  translation  table  to  32  at 
44125  and  14  at  44126.  Some  Upload 
tapes  from  E-Z  Key  share  the  error. 
This  doesn't  affect  translations,  & 
both  programs  run  correctly.  Use  a 
Winky  Board  II  to  load  ZX/TS  tapes. 

Connector  diagrams  in  this 
issue  supercede  information 
published  in  SYNTAX  Dec. 83  pi. 

PROGRAM  IMPROVEMENTS 

To  see  more  ROM  calls  in  Marty 
Iron's  program  translated  for  the 
2068,  you  must  change  lines  100  and 
210  to  use  14446  instead  of  7679. 
Expect  run  time  of  about  1  hour. 

Cassette  Labeler  needs  changes 
in  lines  27  0  and  370  if  you  want  to 
use  full  30-character  lines  on  a 
2068  version.  Insert  PRINT  AT  18,0 
in  both  locations. 

John  Slattery,  Chatham  Township,  NJ 

VENDOR  REPORT 

SYNTAX  expects  to  get  its  act 
together  by  March  84. 

Larry  Weigel  of  Synergistic 
Designs  can  be  reached  by  telephone 
through  312/252-6356.  Larry  says 
the  company  expects  to  move  to  a 
new  location  in  the  Chicago  area  by 
the  end  of  the  first  quarter. 

E.  Arthur  Brown  does  not  have 
thermal  labels  in  stock,  nor  does 
any  other  vendor  known  to  SYNTAX. 

ECC  publications  professed  no 
knowledge  of  any  problem  with  issue 
7  of  Timex-S incla i r  User  on  5  Jan 
1984.  SYNTAX  has  not  received  its 
subscription  copy,  and  we  have  no 
report  from  the  UK  parent  company. 
If  you  wish  to  complain,  your  bank 
or  credit  card  company  and  your 
postmaster  should  assist  you.  Or 
you  may  write  to  Mr.  Richard  Hease, 
Chairman,  ECC  Publications,  196-200 
Balls  Pond,  London,  UK  Nl  4AQ. 

Although  the  New  York  Attorney 
General  sends  form  letters  claiming 
inability  to  locate  any  assets,  you 


should  file  complaints  about  FROG. 
SYNTAX  believes  the  FROG  case  could 
be  serious — it's  crucial  to  build  a 
substantial  file  in  Albany.  Call 
518/474-5481  for  complaint  forms. 

ZXLR8  orders  will  be  filled  by 
G.  Russell — Electronics.  Send  new 
orders  to  RD  1  Bx  539,  Centre  Hall, 
PA  16828  ($11  ppd).  Advanced 
Interface  Designs  no  longer  sells 
this  high-speed  load-save  program. 

We  have  two  more  complaints 
about  non-delivery  from  KOPAK.  The 
complainants  have  neither  product 
nor  refund.  KOPAK  informs  us  they 
will  ship  EZ-LOADER  starting  Feb. 8. 

ZX/TS  USERS'  GROUPS 


To  check  for  a  local  group  that's 
not  listed,  or  to  announce  a  new 
group,  call  617/456-3661  or  write 
SYNTAX,  RD  2  Box  457,  Bolton  Rd., 
Harvard,  MA  01451.  Send  SASE  for 
name  of  group  in  your  area. 

Dayton,  OH:  T/S  Research  Computer 
Club,  Steve  Douglas,  1515  Canfield 
Ave.,  Dayton,  45406,  513/278-8163. 

Long  Island,  NY:  L.I.  Sinclair 
Timex  Group,  Paul  Donnelly,  10  Idle 
Day  Dr.,  Centerport,  NY  11721. 

Send  phone  number  or  SASE. 

Roanoke,  VA:  Roanoke-Franklin 
County  Timex-Sinclair  Area  User's 
Group  meets  the  first  Monday  of 
every  month,  Salvation  Army  Hqtrs, 
7th  St.  and  Dale  Ave.,  7-SK  pm. 
Contact  Gary  Preston,  703/576-2390, 
or  Capt.  Jim  Worthy,  703/343-5335. 

Franklin  County,  VA:  Sinclair 
Local  User  Group  has  changed  its 
name  to  the  Southern  Virginia  Timex 
User's  Network.  Their  newsletter, 
SLUG,  now  goes  by  the  name  of  TUG¬ 
LINES.  Contact  Gary  Preston,  Rt  1 
Box  21,  Glade  Hill,  VA  24092. 

Mexico:  ZX/TS  Users  Group  of 

Mexico.  Contact  Miki  Kronish, 

Apdo.  Postal  5-450,  Guadalajara, 
Jalisco,  MEXICO. 


2 


NEW  PRODUCTS  AND  SERVICES 


Prentice-Hall  publishes  two  new 
books  for  the  ZX/TS:  TIMEX/Sinclair 
Interfacing;  Tested  Interfacing 
Projects  for  the  ZX80,  ZX81 .  and 
Timex/Sinclair  1000  (includes 
instructions  for  building  a  relay 
controller,  A-D  and  D-A  converter, 
joystick  interface,  printer 
interface,  memory,  etc.,  including 
pin-outs  and  specs  for  chips  used) 
for  $10.95  paperback/$17.95 
clothbound,  by  James  Downey  and  Don 
Rindsberg;  30  Games  for  the 
Timex/Sinclair  Computer 
(simulation,  fortune  telling, 
graphics)  for  $4.95  paperback/$9.95 
clothbound,  by  William  Behrendt. 
Available  from  Prentice-Hall, 
Englewood  Cliffs,  NJ  07632, 
201/592-2640. 

G.  Russell  Electronics  announces 
four  new  products;  The  SRS  Speech 
Recognition  System  includes  an 
amplifier  and  software  on  cassette 
for  recognizing  up  to  eight  spoken 
words.  For  TS2068  and  16K  ZX/TS  at 
$34.95  assembled,  $29.95  kit. 
COMPCOOLER  allows  you  computer  to 
run  cooler  by  reducing  the  voltage 
at  the  9VDC  jack.  $7.95  for  ZX/TS 
(except  TS1500).  KEY  cassette 
program  provides  UNLOCK  to  LIST  and 
SAVE  normally  unlistable  programs, 
PROTECT  to  shift  programs  above 
RAMTOP,  MERGE  to  combine  programs, 
and  BYTES  REMAINING  to  give  RAM 
available.  $10.00  for  16K  ZX/TS. 
WINKY  2000  makes  loading  TS2068 
tapes  easier  and  lets  you  copy  any 
program  you  can  LOAD.  Includes 
monitor  jack  and  LED  (avail.  Mar. 
84).  G.  Russell  Electronics,  RD  1 
Box  539,  Centre  Hall,  PA  16828. 

DO-CALC  consists  of  six  linked 
routines;  Calculator©  Factorial, 
Accounting/Statistics,  Running 
Balance,  Tranform/Regression,  and 
Compound  Interest.  Written 
in  BASIC  for  16K  ZX/TS.  $16  ppd. 
from  B.V.  Gerber,  3707  Downey  Dale 
Dr.,  Randallstown,  MD  21133. 


Banta  Software  offers  three  new 
packages  for  the  2068.  SCREEN- 
SOLV,  an  electronic  worksheet  for 
engineers  and  scientists,  capable 
of  solving  algebraic  or 
trigonometric  equations  and 
definite  integrals,  allows  up  to  48 
user  defined  variables  and  six  96 
element  arrays,  incorporation  of 
final  formulae  into  BASIC  programs, 
and  288  step  SCREEN-SOLV  programs. 
Results  can  be  tabulated  or 
plotted.  Available  March  84  for 
around  $35.  SCREEN-CALC,  a 
Visicalc-like  spreadsheet  program, 
allows  up  to  1008  cells  containing 
an  8  letter  label  and  a  number. 

All  standard  TS  BASIC  functions  may 
be  entered  into  cells.  Other 
features  include  sums,  averages, 
conditionals,  loops,  and  menu- 
driven  operation,  all  for  $19.95. 
FOOTBALL,  a  colorful,  challenging 
strategy  game,  offers  both 
offensive  and  defensive  plays  for 
one  or  two  players.  $14.00,  from 
Banta  Software,  8088  Highwood  Way, 
Orangevale,  CA  95662,  916/722-4895. 

Robotec  Inc.  introduces  RAMPAGER,  a 
machine  code  monitor  for  16K  ZX/TS 
machines.  Allows  entry  of  bytes  in 
hexidecimal,  inserts  bytes  (bumping 
all  other  bytes  up),  displays  and 
prints  memory  in  decimal,  hex,  and 
characters.  It  is  NOT  an  assembler 
or  disassembler,  but  it  is  written 
entirely  in  machine  code  and  loads 
in  under  75  seconds.  $9.95  +  $1.25 
P&H  from  Robotec  Inc.,  59  C  St., 
Ampoint  Ind.  Park,  Perrysburg,  OH 
43551,  419/666-2410. 

Color  Graphics  deals  with  practical 
applications  of  high  resolution 
graphics  on  the  TS2068.  Includes 
techniques  for  3-D  drawing,  maps, 
geometric  figures,  pie,  bar,  and 
line  charts,  characters  and  shapes, 
and  moving  objects  on  the  screen. 
Contains  45  tested  program  listings 
with  notes.  By  Nick  Hampshire, 
$12.95  paperback  from  Hayden  Book 
Co.,  10  Mulholland  Dr.,  Hasbrouck 
Heights,  NJ  07604,  201/393-6306. 


3 


TIMEX  SHOWS  NEW  PERIPHERALS 

Model  Description  Avail  Price 

TS2050  Modem  Now  $120 

TS2060  Interface  2Q  84  $110 

TS2080  80  Col.  Printer  IQ  84  $325 

TS2065  Microdrive  2Q  84  $65 

Timex  displayed  these  products 
at  the  1984  Consumer  Electronics 
Show  in  Las  Vegas.  Prices  and 
availability  are  approximate. 

Timex's  new  TS2050  Modem  works 
with  all  Timex-Sinclair  computers 
and  includes  menu  driven  software 
on  cassette.  It  features  direct 
modular  connection,  auto-dial,  and 
auto-answer.  An  optional  command 
cartridge  for  the  2068  dials  up  to 
14  numbers  and  contains  automatic 
logon  procedures. 

For  expanding  the  capabilities 
of  the  2068,  the  TS2060  Interface 
provides  buffered  bus  expansion, 
RS232-C  serial  and  Centronics 
parallel  ports,  a  port  for  an  extra 
32K  RAM.  RGB  color  monitor  output 
with  audio,  a  networking  facility 
for  up  to  64  TS2068s,  and  a  port 
for  up  to  8  microdrives. 

Plugging  into  the  Centronics 
port  of  the  interface,  the  TS2080 
printer  provides  80  columns  of  dot 
matrix  output,  including  all  the 
characters  in  the  TS2068,  in  normal 
or  italicized  format.  It  looks 
like  a  full  sized  computer  printer, 
and  has  a  price  to  match. 

The  most  exciting  item  shown, 
the  TS2065  Microdrive,  reads  and 
writes  tiny  tape  cartridges  about 
the  size  of  a  thin  book  of  matches. 
Each  cartridge  contains  20  feet  of 
tape  in  a  continuous  loop  and  can 
store  80  to  100K  bytes  of  data. 
During  formatting,  the  drive  looks 
for  faulty  portions  of  the  tape  and 
locks  them  out;  thus  the  storage 
figure  is  expressed  as  a  range.  A 
perfect  tape  holds  100K.  The  tape 
runs  at  30  ips,  so  the  entire  loop 
passes  in  8  seconds.  This 
translates  to  a  transfer  rate  of 
102,400  baud  on  a  perfect  tape. 

The  Microdrive  system  supports  both 
program  and  data  files  using 


standard  TS2068  commands  such  as 
CAT,  ERASE,  FORMAT,  OPEN,  etc.  The 
CAT(alog)  command  reads  the  entire 
tape;  there  is  no  single  directory 
area  on  the  tape.  The  Microdrives 
are  powered  from  the  computer. 

Timex  imports  them  from  Sinclair 
while  gearing  up  their  facilities. 

Sinclair  Research  demonstrated 
their  flat-screen  black  and  white 
pocket  television,  with  automatic 
television  standard  selection, 
focus,  horizontal  and  vertical 
hold,  brightness  and  contrast.  It 
measures  5.5x3.5x1.25  inches, 
weighs  12  oz.,  and  costs  $100. 
Slated  availability:  Mid  1984. 

Cedric  Bastiaans,  Los  Angeles  CA 

HARDWARE  REVIEW 

Product:  UM-64  Memory  Module 

Machines:  ZX/TS  (not  TS2068) 

From:  Byte-Back  Co. 

Rt.  3  Box  147  Brodie  Rd. 
Leesville,  SC  29070 
803/532-5812 

Price:  $119.95  Assembled 

$109.95  Kit 
+$4.95  P&H 

Using  bigger  memories  creates 
opportunities  for  greater  losses  in 
a  crash.  Byte-Back's  battery-back- 
up  scheme  cuts  this  risk.  You'll 
also  get  the  possibility  to  have 
your  operating  system  in  RAM  (all 
but  the  characters),  compatibility 
with  the  TS1500,  switch-selectable 
banks  in  the  8-16K  area,  an  EPROM 
socket  you  can  switch-select  into 
8-16K,  and  reasonable  documentation 
from  a  company  that  maintains  an 
evening  help  line. 

When  power  fails,  6  alkaline 
batteries  (AA  size)  keep  power  on 
your  system  for  up  to  30  minutes. 
These  backup  batteries  supply  9V  to 
the  entire  system,  including  other 
peripherals.  Don't  run  high-drain 
items — like  a  ZX  printer — from  the 
backup  system.  Also,  if  you're 
going  to  SAVE  to  tape,  you'll  need 
a  battery-powered  tape  recorder. 


You'll  need  fresh  batteries  to 
get  protection  with  this  circuit 
because  the  regulator  will  drop  out 
at  1.22V  per  cell.  Most  cells  are 
rated  at  end-point  voltages  of  1.1V 
or  less — you  can  expect  about  1/3 
rated  life  in  this  circuit.  The 
batteries  only  operate  when  power 
fails,  so  the  calendar  time  can  be 
quite  long.  SYNTAX  recommends 
testing  the  backup  feature 
regularly,  with  non-crucial  data. 

If  you  need  longer  backup 
times,  you  can  change  to  a  larger 
battery  holder,  mounted  externally, 
or  modify  the  circuit  to  use  a  re¬ 
chargeable  pack  similar  to  the  ones 
described  in  SYNTAX  (Aug. 82  p.5). 

Don't  use  the  Reset  function 
during  battery  operation.  Doing  so 
would  wipe  out  all  memory — not  just 
16-32K.  When  you  lose  power,  this 
backup  runs  your  whole  system. 

With  your  UM-64,  you  get  MC  & 
instructions  to  move  your  operating 
system  into  the  RAM,  where  you  can 
modify  the  code  as  you  wish.  Our 
simple  test  modified  the  graphic 
character  codes  to  make  both  the  1 
&  2  keys  print  the  1-key  graphic — 
not  sophisticated,  but  enough  to 
see  that  we  really  operated  from 
RAM.  Changing  the  character  set 
code  in  the  RAM  will  not  suffice  to 
change  the  characters,  though.  The 
part  of  your  ZX/TS  that  reads  these 
codes  is  isolated  electronically 
from  the  edge-connector  where  the 
UM-64  attaches.  One  use  is  to 
change  printer  USR  calls  to  use 
LLIST,  LPRINT  and  COPY. 

Byte-Back's  UM-64  will  work  on 
your  TS1500,  as  well  as  on  the 
other  ZX/TS  machines.  Of  course  it 
doesn't  work  on  Spectrums  or  2068s. 

SYNTAX  could  not  get  the  UM- 
64,  TS1500  and  MW-100  printer  to 
function  together.  By  telephone, 
Jerry  Minchey  informed  us  that  this 
is  a  timing  problem  for  which  Byte- 
Back  provides  a  fix  incorporated  in 
later  production  models  than  we 
tested.  This  fix  also  allows  you 
to  LOAD  32K  BASIC  programs  directly 
and  Jerry  will  provide  it  at  no 


charge  to  people  who  need  it. 

In  a  nice  touch,  this  memory 
provides  two  sets  of  switches  to 
control  the  8-16K  block.  Four  of 
these  disable  2K  blocks  of  internal 
RAM;  four  control  the  address  of 
the  built-in  PROM  socket.  If  your 
system  uses  one  set  configuration, 
you  won't  mind  having  to  open  the 
case  to  set  the  switches.  SYNTAX 
constantly  reconfigures  systems  and 
suggests  that  you  may  want  to  cut  a 
slot  in  the  case. 

Documentation  includes  a  parts 
list,  schematic,  component  layout, 
and  clear  directions  for  use.  You 
also  get  a  clearly  stated  warranty, 
a  real  address,  and  a  phone  number. 

Construction  of  this  unit  uses 
generally  good  practice.  You  will 
find  one  piggy-backed  IC,  a  diode, 
a  resistor,  and  a  3-inch  wire  that 
provide  a  ROM  CS  function.  Also, 
the  battery  leads  can  extend  out  of 
the  case  for  your  convenience.  None 
of  these  are,  by  themselves,  bad — 
but  all  can  cause  you  trouble  in  a 
place  with  lots  of  vibration.  For 
most  uses,  expect  no  trouble.  We 
like  the  gold,  bifurcated  contacts 
on  the  connector. 

HARDWARE  REVIEW 

Product:  ROMPAK  ROM  Card 

Machines:  ZX/TS  Machines  (not  2068) 
From:  Rompak,  8206  Blackburn 

Ave.,  Los  Angeles,  CA 
90048,  213/653-9741 
Price:  $16.95  Assem. ,  with  ZIF 

$9.95  Kit,  without  ZIF 
+$2.00  P&H 

ROMPAK  permits  you  to  use  many 
programs  instantly — cartridges  in 
the  rough.  An  adaptor  plugs  onto 
your  ZX/TS  and  provides  a  socket  to 
contain  the  program  ROM.  A  simple 
machine  code  routine  in  the  ROM 
moves  the  program  into  RAM  in  under 
a  second,  and  you're  ready  to  go. 

You  can  buy  the  assembled  type 
with  ZIF  (Zero  Insertion  Force) 
socket,  or  the  kit  with  regular 
socket  (ZIF  socket  separately 


5 


$4.95).  Both  versions  include  an 
extender  to  connect  other 
peripherals.  Rompak  recommends  the 
ZIF  socket  and  SYNTAX  advises  using 
the  regular  socket  only  for  ROMs 
you  will  never  change. 

This  product  reads  2764  or 
2732  EPROMs  in  the  unused  8-16K 
block  of  ZX/TS  memory.  The  newest 
version  has  a  jumper  for  2716s. 

One  page  of  instructions  give 
all  the  necessary  cautions.  Every 
word  on  this  sheet  is  important — 
read  before  destroying  (your  ROM, 
computer,  adaptor,  or  all  three). 

Components  and  design  of  this 
product  show  good  judgement.  Our 
assembled  version  is  well-built, 
and  uses  a  bifurcated,  gold-contact 
connector  that  fits  very  tightly. 
Tin-plated  extender  pins  allow  you 
to  connect  other  peripherals.  The 
double-sided  glass  circuit  board  is 
cleanly  laid  out  and  well-marked. 

Changing  ROMs  with  the  Rompak 
attached  to  your  computer  will  test 
your  dexterity,  as  the  bottom  of 
the  ROM  socket  lies  too  near  the 
top  of  the  computer — hold  the  ROM 
by  the  ends.  Also,  the  "1" 
referred  to  in  step  4  of  the 
instructions  is  at  the  top  right  of 
the  ROM  socket.  There's  also  one 
below  and  to  the  left,  so  watch  it. 

SYNTAX  tested  two  EPROMS 
available  for  this  product,  one  no 
longer  available.  The  other 
contains  Dan  Tandberg's  programs 
Timeblasters  &  Mazeball.  Both 
require  16K  of  RAM. 

Timeblasters  is  an  arcade  game 
with  moving  graphics.  Your  space 
ship  travels  to  the  right  (we  must 
be  the  good  guys)  and  fires  at 
enemies  moving  leftward.  Actually, 
the  background  moves  by  you.  Your 
moves  are  up,  down  and  fire.  But 
as  you  miss,  time  speeds  up.  With 
6  levels  of  play,  you  can  spend  a 
lot  of  time  getting  good  at  it. 

Mazeball  extends  the  classic 
pong  game  by  bouncing  the  ball 
through  one  of  seven  mazes.  All 
you  gotta  do  is  keep  the  ball 
bouncing — HA! 


REUSABLE  LOOPS — 8K/1K 

You  can  shorten  and  clarify 
some  of  your  programs  by  using  one 
loop  and  several  flag  variables  to 
perform  related  operations.  For  a 
sample,  let's  take  a  utility  that 
creates,  modifies,  moves,  checks,  & 
prints  a  ten-byte  MC  routine. 

You  could  write  separate  loops 
for  each  operation.  But,  since  we 
always  need  10  steps,  one  FOR-NEXT 
sequence  (100  &  190)  will  do.  Once 
inside  the  loop,  we  do  some  things 
on  every  pass,  so  we  put  them  first 
at  lines  102-107.  Next  we  test  the 
flag  variable,  K$,  to  see  which  of 
the  choices  we  want  to  execute  this 
time.  If  we  cannot  complete  the 
task  in  one  statement,  we  use  a 
GOSUB  to  a  lower  line  number.  When 
we  finish,  we  send  the  program  back 
to  our  elementary  menu  to  choose 
the  next  step. 

This  sample  program  also 
includes  several  methods  to  save 
memory.  Single-letter  variable 
names,  a  space  variable  (S$),  and 
tokens  in  the  menu  cut  the  memory 
required  for  this  program.  You  can 
cut  more  by  substituting  variables 
for  numbers,  then  assigning  values 
to  the  variables  in  command  mode. 

Before  you  enter  this  program, 
set  RAMTOP  to  17376  (16514+862)  on 
your  ZX/TS.  This  value  corresponds 
to  RAMTOP  for  Syntactic  Sum  in  IK. 
You  can  now  load  ten  bytes  into  the 
REM  statement  and  manipulate  them. 
Using  the  POKE  option,  you  over¬ 
write  10  bytes  of  Syntactic  Sum. 

When  you  enter  this  program, 
use  only  keywords  following  the 
colon  in  line  2.  When  you  operate 
the  program,  just  touch  the  key 
that  controls  the  keyword — 0  for 
POKE — and  the  program  responds. 

One  feature  needed  here,  but 
not  implemented,  is  a  test  of  K$ 
for  keys  not  on  the  menu.  If  you 
push  an  unflagged  key,  the  program 
doggedly  traverses  the  loop  ten 
times,  doing  nothing,  then  returns 
the  menu  message.  SYNTAX  would 
love  to  see  a  memory-efficient  way 


6 


to  test  for  "none  of  the  above"  in 
an  arbitrary  menu. 

INPUT  lets  you  enter  decimal 
code  that  will  transform  the  REM 
statement  to  a  short  machine-code 
routine.  You  see  the  address,  put 
in  the  code,  see  the  code  next  to 
the  address,  and  proceed.  Enter  0 
to  create  a  NOP,  or  201  to  for  a 
return,  in  spaces  you  don't  use. 

LPRINT  lists  the  byte  number, 
REM  address,  code  in  REM,  MC 
address  above  RAMTOP,  and  content 
of  that  address  to  your  printer. 

PRINT  generates  the  same 
display  on  your  monitor  or  TV. 

POKE  takes  the  bytes  from  the 
REM  statement  and  inserts  them  862 
bytes  higher,  above  the  RAMTOP  you 
set  prior  to  loading  the  program. 

STOP  lets  you  break  out  of  the 
program  to  perform  other  operations 
of  your  choice. 

To  alter  the  BASIC  program  for 
Spectrum  or  2068  operation,  locate 
the  beginning  address  of  program 
space,  add  5  and  substitute  the 
result  for  the  constant  16514. 

PEEK  2  3635+256*PEEK  2  3636  gives  the 
address  for  your  2068  or  Spectrum. 
Set  RAMTOP  where  you  want,  then 
change  the  constant  862  to  reflect 
the  difference  in  REM  and  RAMTOP 
addresses . 

Spectrum  and  2068  users  gain 
nothing  by  storing  machine  code  in 
REM  statements;  these  machines  let 
you  SAVE  machine  code.  But  these 
instructions  will  let  you  try  this 
reusable  loop  example. 

You  can  expand  this  program  to 
handle  up  to  32  bytes  by  expanding 
the  REM  statement  and  changing  the 
upper  value  of  I  in  line  100.  Do 
not  make  those  changes  until  the 
short  version  works.  This  program 
is  slow  and  will  annoy  you  during 
testing  if  you  also  make  it  long. 

Expanding  the  concept,  you  can 
use  several  flag  variables  and  more 
complex  tests  to  make  user-friendly 
routines  with  one  master  loop,  but 
many  functions.  Arrange  the  tests 
(IF  statements)  so  the  most  likely 
choice  is  tested  first. 


RAND  AND  AUTORUN 


RAND  will  not  work  properly  on 
ZX/TS  machines  if  the  program  RUNS 
automatically  when  LOADed.  Type  in 
this  program  and  SAVE  via  GOTO  40: 


i_  k_-  r\  n  i  '4  l-- 


Now  LOAD  "RANDOM"  and  watch  the 
numbers  on  the  screen.  LOAD  again 
and  you  will  see  the  same  sequence! 
RAND  works  by  counting  the  frames 
displayed  between  the  time  the 
program  started  running  and  the 
execution  of  RAND.  When  RUN 
automatically,  this  number  is 
always  the  same.  Using  50  GOTO  10 
instead  of  RUN  yields  the  same 
result.  To  solve  this  problem,  add 
a  PAUSE  before  RAND,  so  your 
program  looks  like  this: 


r~:  T~i  T  iv  iT 
£=.  xJ  T-  r*.  -L  I  I 


Harold  Miller,  Ph.D.,  Clayton  GA 
7 


TS2068  CONNECTOR  PINOUTS 

This  information,  from  TIMEX 
Technical  Memo  #6,  is  supplied  by 
TIMEX  for  publication  by  SYNTAX. 

Boldface  indicates  active  low 
or  inverted  signals  (normally 
indicated  via  an  overline).  The 
letter  B  appended  to  the  end  of  a 
signal  name  indicates  the  TS2068 
buffers  the  signal. 

REAR  EDGE  CARD  CONNECTOR 

Solder  Side  Component  Side 


Sig  GND 

IB 

1A 

Sig  .GND 

SPK/TAPE  2B 

2  A 

EAR 

+15V 

3B 

3A 

A7RB 

+5V 

4B 

4A 

D7 

Unused 

5B 

5A 

DZIN 

Slot 

6B 

6A 

Slot 

POW  GND 

7B 

7A 

D0 

POW  GND 

8B 

8A 

D1 

0 

9B 

9A 

D2 

A0 

10B 

10A 

D6 

A1 

11B 

HA 

D5 

A2 

12B 

12A 

D3 

A3 

13B 

13A 

D4 

A15B 

14B 

14A 

INT 

A14B 

15B 

15A 

NMI 

A13B 

16B 

16A 

HALT 

A12 

17B 

17A 

_  MREOB 

All 

18B 

18A 

IOROB 

A10 

19B 

19A 

RDB 

A9 

2  0B 

2  0A 

WRB 

A8  \ 

21B 

21A 

BUSAK 

A7 

22B 

22A 

WAIT 

A6 

2  3B 

2  3A 

BUSRO 

A5 

24B 

24A 

RESET 

A4 

25B 

25A 

Ml 

DZOUT 

2$B 

2  6A 

RFSHB 

R 

27B 

27A 

EXROM 

G 

28B 

2  8A 

ROSCS 

B 

29B 

2  9A 

BE 

BUSISO 

3  0B 

30A 

IOA5 

VIDEO 

31B 

31A 

SOUND 

Sig  GND 

32B 

32A 

Sig  GND 

Pins  4-26  comprise  the  ZX/TS 
compatible  pins.  Use  a  64  pin  0.1" 
dual  readout  edge  card  connector  to 
mate  with  this  card  edge.  Case 
clearance:  0.20"  (top),  0.25" 
(bottom),  and  0.15"  (sides). 


ROS  (a/k/a  DOCK,  TCC)  CONNECTOR 
Solder  Component 


_A14B 

1 

2 

+5V 

A12 

3 

4 

A13B 

.00 

5 

6 

D7 

D1 

7 

8 

A0 

D2 

9 

10 

Al 

D6 

11 

12 

A2 

D5 

13 

14 

A3 

D3 

15 

16 

A15B 

D4 

17 

18 

MREOB 

IOROB 

19 

20 

A7RB 

RDB 

21 

22 

Ml 

WRB 

23 

24 

. A8 

A7 

25 

26 

A9 

A6 

27 

28 

Al  0 

A5 

29 

30 

All 

A4 

31 

32 

RFSHB 

BE 

33 

34 

EXROM 

ROSCS 

35 

_3£_ 

GND 

ROS  stands  for  ROM  Oriented 
Software;  TCC  stands  for  Timex 
Command  Cartridge.  Use  a  36  finger 
0.1"  double  sided  edge  card  with  a 
slot  between  pins  4  and  6  to  mate 
with  this  connector.  Cartridge  bay 
dimensions:  2.25"  (width  at 
bottom),  2.55"  (width  at  top), 

0.45"  (height),  and  3.35"  (depth, 
including  edge  card  fingers). 


JOYSTICK  CONNECTOR 


/ 

/ 

/  5 
9 

4 

8 

3 

7 

2 

6 

\  1 

\ 

\_ 


Pin  STICK  Signal  Meaning 

1  1  DIR1  Up 

2  2  DIR2  Down 

3  4  DIR3  Left 

4  8  DIR4  Right 

5  Unused 

6  1  BUTTON  Button  Input 

7  +5V  +5V  DC  Power 

8  RDSTB  Read  Strobe 

9  Unused 

(See  pp  173-5,  2068  Manual) 


Use  a  female  9-pin  D  connector 
(DB9S,  Atari  Standard)  to  mate  with 
this.  The  value  STICK  returns 
appears  above.  STICK  reads  through 
the  8912  sound  chip  I/O  port.  The 
actual  bit  value  for  the  button  on 
this  port  is  128. 


8 


SIGNAL  NAMES  AND  MEANINGS 


BIORHYTHMS — 8K/1 6K 


Symbol 

Meanina 

Signal  GND 

Logic  Ground  Ref 

Power  GND 

Power  Supply  Ground 

+15V 

+15V  DC  Power 

+5V 

+5V  DC  Power 

SPKR/TAPE  OUT 

Tape  MIC  jack  signal 

EAR 

Tape  EAR  jack  signal 

R 

Red  Color  (TTL) 

G 

Green  Color  (TTL) 

B 

Blue  Color  (TTL) 

VIDEO 

Composite  Video 

0 

System  clock 

A0-A12 

Address  Lines  0-12 

A13B-A15B 

Address  Lines  13-15 

A7RB 

Refresh  Addr  bit  7 

D0-7 

Data  Lines  0-7 

BUSISO 

Bus  Isolate 

DZIN 

Daisy  Chain  In 

DZOUT 

Daisy  Chain  Out 

INT 

Interrupt  Request 

NMI 

Non-maskable  Intrpt 

HALT 

CPU  Halt  Output 

MREQB 

Memory  Request 

IORQB 

Input/Output  Request 

RDB 

Read 

WRB 

Write 

BUSAK 

Bus  Acknowledge 

WAIT 

CPU  Wait  Output 

BUSRQ 

Bus  Request 

RESET 

CPU  Reset  Input 

Ml 

CPU  Ml  State  Output 

RFSHB 

Refresh 

EXROM 

Extension  ROM  Enable 

ROSCS 

ROS  Chip  Select 

BE 

Bank  Enable 

I0A5 

8912  I/O  Port  bit  5 

SOUND 

8912  Sound  Output 

BUSISO  tristates  all  buffered 
signals  (those  ending  in  B) .  IOA5 
is  the  8912  I/O  port  bit  not  used 
by  the  joystick  circuitry.  RGB 
color  signals  do  not  include  sync 
(sync  must  be  stripped  off  VIDEO). 

NOT  ENTIRELY  CLEAR — 8K/1K 

Enter  this  line  by  hitting  1, 
CLEAR,  cursor  back,  REM,  NOT,  /. 
Execute  via  RAND  USR  16514. 


Dan  Tandberg,  Albuquerque  NM 


I  wrote  this  program  as  a 
result  of  a  great  disappointment  I 
experienced  after  purchasing  a 
Biorhythms  program  from  one  of  the 
prominent  software  companies.  The 
program  did  not  print  an  accurate 
set  of  curves,  and  did  not  print  a 
mathematically  correct  result. 

I  developed  a  printing  routine 
first,  which  works  on  a  PLOT, 

PRINT,  UNPLOT  basis,  allowing  a 
sine  plot  made  of  letters.  The 
positive  half  of  the  curve  usually 
prints  first,  then  the  rest  of  the 
curve  in  reverse  (negative  STEP). 

Biorhythms  computes  time  (T)  in 
days  and  divides  it  by  each  cycle 
length  to  get  the  number  of  cycles 
since  birth.  It  decides  where  to 
print  each  curve  by  converting  the 
fraction  of  each  cycle  remaining  to 
X  PLOT  coordinates  (J)  relative  to 
the  date  line.  The  date  line 
displays  2  pixels  offset  (column 
16)  to  make  it  read  accurately. 

With  15  days  on  each  side  of 
the  graph  date,  the  completed  chart 
represents  a  31-day  time  spread. 
Relevant  information  appears  at  the 
top  and  bottom  of  the  display,  for 
a  permanent  record  if  you  COPY. 

Each  date  displays  after 
INPUT.  After  you  enter  a  name, 
Biorhythms  goes  into  fast  mode, 
usually  making  the  time  and  offset 
computations  in  under  3.5  seconds. 
The  graph  printing,  taking  about  a 
minute  and  a  half,  is  rather 
interesting  to  watch  (you  wonder 
where  the  next  curve  will  hit). 

After  typing  the  program,  SAVE 
it  with  GOTO  1000.  It  will  run  as 
soon  as  SAVEing  completes  and  after 
LOADing.  Prompts  are  adequate,  but 
if  the  program  stops  a  simple  "GOTO 
150"  will  bring  it  right  back. 

Important  variables: 

T  =  Time  in  days 

W  =  Number  of  cycles  since  birth 
J  =  Sets  start  pt  of  sin  print 
L  =  Sets  start  pt  of  back  print 


9 


Lines  5-45 . Intro  display 

Lines  145-275  ....  Prompts  and  Input 
Lines  297-360. .. .Graph  Print  +  Info 
Lines  37 0-600. .. .Sin  Print  P,E,I 
Lines  61 0-71 0. .. .More  prompts  and 

terminate  display 
Lines  82 0-885  ... .Time  Computation 
Lines  89 0-986 ... .X-Axis  Offset 

Computations 

This  program  uses  up  about 
6.2K  of  RAM.  I  have  an  enhanced 
version  with  more  user-friendliness 
and  error-trapping  features  that 
also  prints  out  a  compatibility 
factor  between  two  persons  when 
given  the  birth  dates  of  each, 
within  a  10%  range  for  each  curve. 
It  uses  a  little  more  than  15K  of 
RAM  and  includes  a  brief 
explanation  of  biorhythm  theory. 

I  will  furnish  the  extended 
15K  version  by  mail  to  anyone  for 
$10.00  post  paid. 

Doug  McRoy 
5  Pfister  St 
Laurel,  MD  20707 


lO 


DEAR  EDITOR: 


For  a  TS2068  version  of  Dave 
Wood's  HIGH  LINE  NUMBERS  (SYNTAX 
Dec. 83  p4)  you  need  only  add  two 
PEEKS  which  locate  the  line  number 
bytes  in  memory.  Line  numbers 
store  as  high  byte  followed  by  low, 
reversed  compared  to  most  other  16- 
bit  quantities. 

On  your  TS2068,  enter  as  line 
1  the  line  which  will  be  last  in 
the  listing  (highest  line  number). 
Then  use  this  direct  command: 

LET  a=PEEK  23635+PEEK  23636*256: 
POKE  a,  (hi  byte):  POKE  a+l,(lo  byte) 
Write  down  decimal  values  of  POKEd 
lines  (high  byte*256+low  byte);  any 
line  numbered  higher  than  16383 
(63*256+255)  won't  show  on-screen. 

To  add  more  high-number  lines, 
enter  the  next  highest  line  in  the 
listing  as  line  1.  As  long  as  RUN 
or  CLEAR  have  not  been  used  after 
defining  a  in  memory,  use  the 
direct  command: 

POKE  a,  (hi  byte):POKE  a+l,(lo  byte) 
The  highest  possible  line  number  is 
32767  (hi  byte=127  &  lo  byte=255). 

Only  lines  numbered  less  than 

16383  will  function  with  a  normal 
RUN  command,  GO  TO,  or  GO  SUB. 

Lines  numbered  from  16384  to  32767 
will  function  only  by  a  direct  RUN 
or  GO  TO  and  then  execute  only  the 
statement  contained  in  that  line — 
useful  only  as  a  curiosity  or  to 
store  listings  off-screen.  When 
lines  numbered  1-9999  are  pushed 
off-screen  by  a  line  numbered  from 

16384  to  32767,  and  a  GO  TO  is  then 
made  to  the  high-numbered  line,  it 
will  be  processed  along  with  the 
normal  lines  which  follow  it  in  the 
listing  order. 

To  EDIT  the  last  line  entered, 
if  it  doesn't  show  on-screen,  enter 
the  direct  command  POKE  a,l.  Lines 
10,000  to  16383  may  be  brought  down 
with  EDIT,  re-numbered  to  less  than 
10,000,  revised,  and  POKEd  back  to 
a  high  number.  You  can  calculate 
the  location  of  line  number  bytes 
after  the  first  line  in  a  listing, 
but  otherwise  the  only  way  to  EDIT 


a  line  POKEd  above  9999  is  to 
delete  all  preceding  lines  in  the 
listing,  both  on-  and  off-screen. 

For  locating  start  of  2nd  line: 

1  LET  a=PEEK  23635+PEEK  23636*256 

2  PRINT  "Demo" 

3  FOR  n=a  TO  a+1000 

4  IF  PEEK  n=l 3  THEN  LET  a=n+l : 

GO  TO  10 

5  NEXT  n 

10  POKE  a, 10 
20  LIST 

In  comment  on  the  "New  image" 
Timex  now  has  for  their  1-800- 
24-TIMEX  customer  support  service, 
in  contrast  to  the  rather  vague 
responses  most  of  us  received  in 
the  past,  they  very  helpfully 
provided  me  with  a  schematic,  I/O 
map,  and  pin-out  as  well  as  an 
approximate  availability  date  on 
the  forthcoming  TS2  000  Advanced 
Programming  Concepts  Manual.  I 
greatly  appreciate  this  kind  of 
support  and,  judging  from  the 
amount  of  time  it  took  me  to  get  a 
free  line  on  the  TIMEX  number,  I  am 
sure  there  are  many  others. 

Robert  Hartung,  Palmyra,  NY 

SYNTAX  (Aug. 82  pl9)  describes  the 
illegal  line  number  3E00H  (15872) 
as  the  marker  for  the  top  of  the 
GOSUB  stack  in  ZX/TS  machines.  The 
Spectrum  uses  the  same  marker,  but 
we  don't  know  about  the  2068. — KO 


MAINTAINING  THE  ZX81 

Calling  1-8 00-24-TIMEX  seems 
an  exercise  in  futility.  After  4 
days  of  20-30  calls  per  day,  I  gave 
up.  Only  twice  did  I  get  a  ring. 

On  these  two  occasions  the  nice 
recorded  voice  told  me  "everyone  is 
busy,  please  be  patient,  someone 
will  soon  help  you."  In  about  ten 
seconds,  the  line  disconnected. 

I  was  trying  to  call  about  a 
replacement  ULA  chip  for  my  TS1000, 
out  of  warranty,  modified  circuit 


12 


board  system.  I  guess  I  zapped  it 
with  body  electrostatic  charge, 
although  it  broke  out  while  typing 
in  a  program. 

Testing  the  system  using  an 
oscilloscope  I  found  no  clocked 
signals  associated  with  ROMCS  and 
RAMCS  (6.5  Mhz  clock  was  OK). 

Since  contacting  TIMEX  was  a 
total  failure,  I  then  spent  about 
$30.00  on  phone  calls,  eventually 
locating  a  TS1000.  Believe  me,  the 
inventory  of  TS1000  computers  in 
the  US  is  very  close  to  zero.  If 
Syntax  readers  want  to  obtain  a 
"spare"  for  their  upgraded  ZX/TS 
systems,  I  advise  them  to  act  now. 
Sunset  Electronics  (415/665-8330), 
still  has  a  few  at  $29.95  as  of 
this  writing.  Some  twenty  other 
suppliers  I  called  have  none  and 
cannot  get  more.  For  $29.95  plus 
shipping  I  can  get  a  spare  set  of 
ULA  and  ROM  chips  for  my  future 
needs.  I  suspect  a  spare  ULA  chip 
would,  itself,  cost  up  to  $20.00, 
if  one  could  be  found. 

US  replacements  for  British 
transistors:  Sylvania  ECG-123AP 
replaces  ZTX-313;  ECG-391  replaces 
ZTX-750  and  ZTX-752.  Almost  any 
"signal  diode,"  such  as  1N34A,  will 
replace  any  diode  on  the  board. 

The  crystal  located  in  the  circuit 
between  pin  35  of  the  ULA  chip  and 
pin  26  of  the  Z80  CPU,  can  be 
replaced  with  an  ordinary  JAN  6.5 
MHz  crystal  (smallest  metal  can 
crystal  with  axial  leads).  All 
other  parts  on  the  circuit  board, 
except  the  ULA  and  ROM  chips,  may 
be  purchased  off  the  shelf. 

Bill  Jones,  Panama  City,  FL 

Use  1N914  or  1N4148  diodes  for  the 
higher  forward  drop  of  Silicon. — KO 


I  think  your  readers  would 
appreciate  the  answers  to  the 
following  questions: 

1)  Why  does  the  Timex  2  04  0 
printer  emit  heat  from  its  top  vent 
even  though  I  have  pressed  the 


"OFF"  button  and  haven't  used  the 
printer  in  days? 

2)  The  new  Timex  2068  computer 
only  seems  to  have  38K  available 
for  programming  (16K  "BASIC"  and 
22K  "VARS");  why? 

3)  What  peripherals  can  be 
used  safely  with  the  Timex  1500 
computer?  (e.g.  when  I  plugged  in 
my  16K  Sinclair  Rampak  the  computer 
went  blank  and  I  had  to  send  it 
back  to  the  supplier.  I  hear  there 
are  problems  if  you  use  a  Memopak 
64K  and  other  hardware  not 
manufactured  by  Timex). 

Wm.  McConaghey,  Pembroke  Pines,  FL 

TS2040  printers  emit  heat  when  off 
because  the  switch  doesn't  turn  off 
the  24V  printhead  power. 

Most  computers  use  some  RAM  to 
perform  functions  that  permit  your 
programs  to  operate.  Sharon  Aker 
reports  that  the  Commodore  64  also 
allows  only  38911  bytes  for  users 
compared  with  38652  in  the  TS2068. 
Page  254  of  the  user's  manual  shows 
how  a  2  068  uses  memory.  I  know  of 
no  16K  BASIC  limit  in  2068's,  but 
SYNTAX  has  discussed  it  at  length 
for  ZX/TS  operation,  including  ways 
to  get  around  it.  (Sep. 82  pl3;  SQ 
Summer  83  p47  &  Nov. 83  pl2) 

TS1500  computers  will  operate 
with  any  accessory  that  doesn't  use 
RAMCS  to  disable  the  internal  RAM. 
On  15 00's,  RAMRM  moves  the  internal 
RAM  to  32-48K  and  leaves  it  active. 
Sinclair  RAMpaks  do  work,  and  Byte- 
Back  memories  and  modules  operate 
(SYNTAX  Nov. 8 3  pl4).  We  hear  that 
some  15  00's  would  not  drive  Timex 
printers,  and  the  2040  printer  will 
destroy  the  data-line  timing.  See 
SYNTAX  Nov. 83  p2  for  details  of  the 
fix  for  2040-generated  problems — KO 


PLEASE:  Check  SYNTAX  back  issues 
before  you  write.  We  can't  reply 
to  individual  technical  letters  or 
republish  data.  We  must  devote  our 
resources  to  new  problems.  Phone 
617/456-3661  or  buy  a  Works. 


13 


RENUMBER —  8K/1 6K 

Utility  programs  for 
renumbering  the  lines  of  BASIC 
programs  facilitate  merging  with 
other  programs,  spreading  out  line 
numbers  to  make  room  for  additional 
lines,  and  neatening  up  finished 
programs.  Changing  line  numbers  is 
easy,  but  a  useful  renumbering 
utility  must  also  fix  the 
destination  line  numbers  in  GOTOs 
and  GOSUBs,  a  more  difficult  task. 
This  program  does  the  job,  although 
slowly  since  it  is  written  almost 
entirely  in  BASIC. 

If  you  have  a  program  merging 
utility,  RENUMBER  can  be  appended 
to,  and  used  to  renumber,  any  BASIC 
program  of  less  than  about  12,000 
bytes  (provided  its  line  numbers 
initially  extend  no  farther  than 
9722).  Even  without  a  merge 
utility,  RENUMBER  can  still  be 
useful.  LOAD  it  first,  then  key  in 
your  main  program  as  you  develop 
it. 

Note  the  partial  Syntactic 
Sums  given  at  several  points  in  the 
listing.  When  typing  in  RENUMBER, 
get  a  Syntactic  Sum  at  each  of 
these  checkpoints  and  correct  any 
mistakes  before  proceeding.  This 
will  reduce  the  number  of  lines  you 
need  to  search  to  find  your  error. 
Since  this  is  a  self-starting 
program,  the  final  Syntactic  Sum 
reflects  the  program  after  it  has 
been  SAVEd  and  then  LOADed  from 
cassette . 

After  typing  in  RENUMBER,  SAVE 
it  to  cassette  with  the  command 
GOTO  9976.  Whenever  LOADed  it  will 
self-start  and  execute  Lines  9978 
to  9994,  storing  two  machine 
language  subroutines  into  high 
memory.  You  must  set  RAMTOP  to 
address  32512  or  lower,  and  NEW  to 
reinitialize  the  machine  stack 
prior  to  loading  RENUMBER.  The 
machine  code  loads  at  addresses 
32512  to  32542.  It  is  relocatable, 
but  this  requires  appropriate 
changes  in  Lines  9890,  9892,  9904, 
9982,  9990,  and  9996. 


RENUMBER  ignores  any  GOTO  or 
GOSUB  whose  destination  line  number 
does  not  begin  with  a  digit.  With 
this  exception,  RENUMBER  correctly 
handles  the  renumbering  of  all  (or 
any  part  of)  a  BASIC  program. 

You  must  specify  what  part  of 
the  target  program  is  to  be 
renumbered,  the  new  starting  line 
number,  and  the  desired  increment 
between  line  numbers.  If  only  a 
portion  of  the  target  program  is 
renumbered  the  user  must  be  very 
careful  in  selecting  the  new 
starting  number  and  the  increment. 
The  line  numbers  that  result  from 
renumbering  must  be  consistent  with 
(i.e.,  in  correct  numerical  order) 
the  rest  of  the  program,  otherwise 
the  resulting  program  may  crash. 
Note  that  entering  0  in  response  to 
the  first  prompt  renumbers  the 
entire  program. 

RENUMBER  starts  by  searching 
the  entire  program,  line  by  line, 
(main  search  routine  starts  at  line 
9826)  looking  for  IF,  GOTO,  or 
GOSUB  statements.  When  an  IF 
statement  is  found,  the  rest  of 
that  statement  is  scanned  to  see 
whether  it  contains  a  GOTO  or 
GOSUB.  If  so,  the  program  jumps  to 
the  GOTO/GOSUB  processing  routine 
at  Line  9848.  Otherwise  it  jumps 
back  to  the  main  search  routine. 
Line  9842  avoids  misinterpreting 
bytes  within  floating  point  numbers 
as  GOTO  or  GOSUB  tokens,  ignoring  5 
bytes  following  code  126. 

The  core  of  the  prpgram  begins 
at  line  9848,  the  GOTO/GOSUB 
processing  routine.  After  the 
token  for  GOTO  or  GOSUB  Sinclair 
BASIC  puts  the  codes  for  the 
decimal  digits  of  the  destination 
line  number,  then  a  "number"  token 
(code  126),  then  five  bytes  holding 
the  number  in  floating-point  binary 
form,  then  a  newline  character 
(code  118).  Lines  9848  to  9860  put 
the  characters  following  GOTO  or 
GOSUB  into  D$  if  it  is  a  number, 
but  if  the  first  destination 
character  is  non-numeric  it  jumps 
back  to  the  main  search  routine. 


14 


Lines  9862  to  9874  determine 
whether  or  not  the  number  in  D$  is 
a  bona-fide  line  number  within  the 
part  of  the  program  being 
renumbered.  If  not,  RENUMBER  jumps 
back  to  the  main  search  routine, 
without  making  any  changes. 
Otherwise,  it  determines  what 
position  that  line  occupies  in  the 
section  of  the  program  being 
renumbered  and  puts  that  position 
number  into  variable  DC.  The  new 
line  number  will  be  the  position 
number  times  the  step  size  plus  the 
new  starting  line  number. 

Both  the  old  line  number  and 
the  new  line  number  may  have 
anywhere  from  one  to  four  digits  (1 
to  9722).  If  the  new  number  is 
shorter  than  the  old,  lines  9886 
and  9888  put  enough  leading  zeroes 
in  front  of  the  new  number  to  make 
it  the  same  length  as  the  old.  But 
when  the  new  number  is  longer  than 
the  old,  RENUMBER  makes  room  for  it 
in  the  program  line  by  moving  the 
rest  of  the  target  program 
(including  all  of  RENUMBER  itself) 
upward  in  memory  by  one,  two,  or 
three  bytes.  There  is  a  suitable 
"make  room"  routine  already 
available  in  the  system  ROM,  at 
address  2459.  It  moves  the  memory 
block  starting  at  the  address 
pointed  to  by  register  pair  HL  and 
ending  at  the  end  of  the  program, 
one  byte  up,  adjusting  the  system 
variables  accordingly. 

Lines  9890  and  9892  POKE  into 
memory  locations  32512  and  32513 
the  address  to  load  into  HL.  The 
FOR. ..NEXT  loop  beginning  at  line 
9894  makes  one  or  more  USR  calls  to 
the  machine  code  routine  at  address 
32514,  which  in  turn  loads  the 
stored  address  into  register  pair 
HL  and  calls  the  ROM  routine  to 
"make  room".  This  loop  also 
adjusts  the  length  bytes  of  the 
newly  expanded  program  line. 

The  "make  room"  routine  moves 
the  bytes  of  the  BASIC  line  that 
called  it,  resulting  in  the  return 
address  being  off  by  one  byte  and, 
normally,  a  crash.  BASIC  can 


easily  be  tricked  into  returning  to 
the  correct  address:  Line  9902 
gets  the  address  of  Line  9904  from 
system  variable  NXTLIN  and  POKES 
the  length  of  line  9904  so  it  is 
one  byte  too  high  (15  instead  of 
14).  After  the  "make  room"  routine 
executes,  it  returns  to  the 
location  15  bytes  after  line  9904. 
Line  9904  is  14  bytes  long,  plus 
the  one  byte  it  has  been  moved  by 
the  "make  room"  routine,  so  the  USR 
routine  returns  to  the  correct 
address.  Immediately  after  each 
USR  call  the  phony  length  of  15  is 
corrected  to  the  proper  figure  of 
14  by  Line  9906.  This  line  gets 
the  address  of  line  9908  from 
system  variable  NXTLIN  and  looks 
backward  77  bytes  (the  total  length 
of  Line  9906  plus  part  of  Line 
9904)  to  the  address  of  the  low 
length  byte  of  line  9904. 

Lines  9910  to  9914  POKE  the 
codes  for  the  decimal  digits  of  the 
new  line  number  into  the  program 
line.  Then  Line  9918  gets  the 
address  of  program  variable  ND  from 
system  variable  VARS.  Variable  ND, 
originally  defined  in  line  9738, 
contains  the  value  of  the  new  line 
number  in  floating-point  form,  so 
Lines  9920  to  9924  simply  copy 
those  five  bytes  into  the  program 
line,  over-writing  the  original 
number.  This  process  repeats  for 
each  line  in  the  program  containing 
GOTO  or  GOSUB.  Finally,  lines  9940 
to  9950  renumber  the  lines  within 
the  range  initially  specified. 

You  can  erase  RENUMBER 
completely  with  these  two  commands: 

GOTO  9996  ENTER 

9724  ENTER 

Line  9996  invokes  the  machine 
code  routine  at  address  32521, 
which  calculates  the  total  length 
of  RENUMBER  and  POKES  that  number 
minus  4  into  the  length  bytes  of 
line  9724.  Thus  when  you  delete 
line  9724  the  entire  RENUMBER 
program  goes  with  it,  leaving  your 
finished  main  program  intact. 

C.  C.  Stalder,  Orlando  FL 


15 


I 


16 


ADDR 

7F00 

00005 

00006 

DFILE 

40  OC 

00003 

00016 

ERASE 

7F09 

00010 

MAKER 

7F0  2 

00006 

In  Stock!  ALL  NEW  MD-2 

SMA*T  MODEM  $119.” 

ASSEMBLED  &  TESTED  $149.95 

•  Send  Text  from  Memory 

•  Send  and  receive  Programs  by  Phi 

•  Copy  Information  into  memory  i 
Print  it.  Review  it.  Save  it  on  Tapei 

•  Use  Timex  2040  Printer  or  RS-232  ^ 

•  RS-232  Printer  Port  provided 

•  No  extra  memory  Required. 

COMPUSERVE  PACKAGE  WITH 5 'FREE  HOUI^^iY$39 95 

64-K  MEMORY  $109’5k.t 

the  “ULTIMATE  MEMORY”  $119.95  ASSEMBLED 
FEATURES: 

•  Battery  Backup  •  PROM/ROM  socket 

•  Reset  Switch  •  BYTE-BACK  EXCLUSIVE  FULL  64-K 

WHY  PAY  MORE  FOR  LESS  FEA TURES? 

GET  THE  “ULTIMATE  MEMORY”  8  YTRSACI^S  UM-64 

KEYBOARD . $59.95 

GORILLA/BANANA  PRINTER . $239.” 

NEW  ZX  PRO/FILE  Including  shipping 
Clearly  the  Best  File  Management  Program  Available. 
RS-232  PRINTER  INTERFACE  Only  $59.*  KIT$69.M  ASSEMBLED 
CONTROL  MODULE  8  Relays, 8  Inputs,  $59.”  KIT  $69. w  ASSEMBLED 
16K  MEMORY  UM16  $59.»5  KIT$69.»5  ASSEMBLED  &  TESTED 
Battery  Backup,  reset  switch,  PROM/ROM  socket  PLUS  .  .  . 

1  year,  100%  Trade-in  credit  towards  the  UM-64. 


BYTE  BACK  CO. 

Rt.  3,  Box  147,  Brodls  Road 
Leesville,  S.C.  29070 
ORDER  PHONE  803-532-5812 
Add  $4.95  shipping  and  handling 
90  Day  Warranty  On  All  Modules.  10— Day  Return  Prlviledge 


400C 

00001 

00002 

00003 

DFILE 

7F00 

7F00 

0000 

00004 

00005 

ADDR 

7F0  2 

2A007F 

00006 

MAKER 

7F05 

CD9B09 

00007 

7F0  8 

C9 

00008 

7F09 

21FC25 

00009 
0001  0 

ERASE 

7F0C 

CDD809 

0001  1 

7F0F 

23 

0001  2 

7F1  0 

23 

0001  3 

7F1  1 

23 

0001  4 

7F 1  2 

EB 

00015 

7F1  3 

2A0C40 

00016 

7F1  6 

A7 

0001  7 

7F 1  7 

ED52 

0001  8 

7F19 

EB 

00019 

7F 1 A 

IB 

00020 

7F1B 

72 

00021 

7F1C 

2B 

00022 

7F1D 

73 

00023 

7F1E 

C9 

00024 

;  RENUMBER  MACHINE  CODE 


EQU 

1  6396 

ORG 

32512 

DEFW 

0 

LD 

HL , (ADDR) 

CALL 

RET 

2459 

LD 

HL ,9724 

CALL 

2520 

INC 

HL 

INC 

HL 

INC 

HL 

EX 

DE  ,  HL 

LD 

HL , (DFILE) 

AND 

A 

SBC 

HL  ,DE 

EX 

DE  ,  HL 

DEC 

DE 

LD 

(HL)  ,  D 

DEC 

HL 

LD 

RET 

(HL)  ,  E 

; ADDRESS  POKED  IN  BASIC 
;  GET  ADDRESS  IN  HL 
; CALL  "MAKE  ROOM" 

;  BACK  TO  BASIC 

;  FIRST  LINE  #  IN  RENUM 
;  LOOK  UP  ADDRESS 
;  POINT  HL  TO  HIGH 
;  TEXT  LENGTH  BYTE 
; OF  LINE  9  724 
;  SAVE  HL  IN  DE 
; HL= ADDRESS  OF  DFILE 
;  CLEAR  CARRY  FLAG 
;  HL=#  PROG  BYTES  MINUS  3 
;  RECOVER  LEN  PTR  IN  HL 
;  DE=#  PROG  BYTES  MINUS  4 
; CHANGE  HI  BYTE  LEN  9  724 

; CHANGE  LOW  BYTE  LEN  9  724 
;  BACK  TO  BASIC 


17 


PI — 8K/16K 

This  program  can  calculate  PI 
to  over  8000  decimal  places —  but 
don't  hold  your  breath.  It  takes 
over  12  hours  for  512  digits!  The 
algorithm  uses  base  100  arithmetic, 
storing  each  digit  in  one  byte  of  a 
character  string  (codes  0-99).  It 
is  based  on  the  Taylor  series  for 
the  arctangent. 

First  PI  prints  out  8  digits, 
then  it  starts  all  over  again  and 
does  16,  then  32  ,  64  ,  etc.  If  you 
don't  have  a  printer,  change  all 
the  LPRINTs  to  PRINTS  and  add  a 
STOP  at  line  6095.  Go  on  to  the 
next  calculation  with  CONT. 

Since  the  program  allocates 
12K  of  RAM  for  the  accumulators 
A$  (1 ) ,  A  $ ( 2 ) ,  and  A$(3),  CLEAR 
before  SAVEing  to  avoid  storing 
lots  of  variable  space  to  tape. 

Blanchard  D.  Smith 
Alexandria  VA 


For  the  TS2068,  translate  with 
FIRSTLOADER  (SYNTAX,  Dec.  83),  then 
delete  lines  60  and  70,  add  55,  and 
replace  180: 


18 


KALEIDOSCOPE — 8K/16K 

I  resorted  to  machine  code  in 
an  effort  to  write  a  fast  program 
to  display  a  kaleidoscope  pattern 
on  the  ZX/TS  screen.  The  resulting 
images  may  be  viewed  on  the  screen 
and  printed  out  at  will. 

In  order  to  get  random  numbers 
for  the  plot  locations  in  machine 
code,  I  used  the  FRAMES  system 
variable  (locations  16436  and 
16437)  to  set  a  pointer  into  the 
ROM.  The  program  reads  bytes  out 
of  the  ROM  and  increments  the 
pointer  for  each  random  number.  If 
the  pointer  goes  too  high,  it  is 
reset  to  0.  This  method  shows  no 
visible  signs  of  repetition. 

To  enter  KALEIDOSCOPE,  type  in 
listing  1.  Put  145  spaces  after 
the  message  in  line  1,  and  no  space 
between  "KALEIDOSCOPE"  and  "PRESS". 
Line  20  contains  32  spaces.  RUN 
the  program  and  enter  the  numbers 
in  table  1.  For  each  number,  the 
display  will  show  an  address  and 
wait  for  you  to  enter  the  contents. 
After  you  enter  a  number  it  will 
appear  on  the  screen.  If  correct, 
hit  ENTER,  otherwise  press  any 
letter  key  and  reenter  the  number. 
After  entering  all  144  numbers,  the 
Syntactic  Sum  should  be  29651. 

Now  delete  lines  10-100  by 
entering  each  line  number.  Type  in 
lines  10-50  as  shown  in  listing  2. 

Be  sure  you  are  in  SLOW  mode, 
then  set  your  cassette  to  record 
and  RUN.  The  program  SAVEs 
automatically  and  RUNs  when  LOADed. 
When  done  SAVEing,  the  title  will 
appear  on  the  screen  for  a  few 
seconds,  and  then  the  screen  will 
begin  flashing  somewhat  random 
patterns.  Press  any  key  and  the 
main  part  of  the  program  will 
begin.  To  print  a  copy  of  the 
screen,  hit  any  key.  You  can  save 
a  picture  on  tape  by  changing  line 
30  to  SAVE  "KALEIDOSCOPE".  The 
program  stops  if  you  press  BREAK. 

[This  program  can  generate 
three-dimensional  effects  if  you 
print  out  the  screen  twice  with  a 


small  time  for  the  pattern  to 
change  in  between.  Hold  the  output 
sideways  and  cross  your  eyes  until 
the  two  patterns  merge;  some  points 
appear  to  recede  into  the  paper  and 


some  appear 

to 

jump 

out, 

i 

Ed.] 

Scott 

H.  McGur 

r  in. 

Macedon  NY 

42 

12 

64 

1 

2  08 

0 

9 

2  35 

33 

130 

64 

1 

12 

0 

2  37 

176 

2  35 

1 

25 

1 

9 

2  35 

1 

22 

0 

237 

176 

17 

0 

200 

27 

122 

179 

32 

251 

237 

87 

60 

237 

71 

2  05 

187 

2 

36 

40 

245 

62 

30 

2  37 

71 

2  05 

42 

10 

2  05 

187 

2 

36 

32 

250 

42 

52 

64 

203 

180 

203 

188 

70 

35 

2  03 

176 

2  03 

184 

62 

43 

184 

56 

245 

78 

35 

203 

177 

2  03 

185 

126 

35 

203 

71 

32 

3 

175 

24 

2 

62 

128 

245 

2  05 

41 

65 

62 

43 

144 

71 

241 

245 

2  05 

41 

65 

62 

63 

145 

79 

241 

245 

2  05 

41 

65 

62 

43 

144 

71 

241 

2  05 

41 

65 

229 

2  05 

187 

2 

36 

225 

40 

186 

2  01 

197 

229 

50 

48 

64 

2  05 

178 

11 

225 

193 

2  01 

Table  1.  Numbers  to  POKE 


19 


00001 

; KALEIDOSCOPE  MACHINE 

CODE 

00002 

400C 

00003  DFILE 

EQU 

16396 

4034 

00004  FRAMES 

EQU 

16436 

• 

4082 

00005 

ORG 

16514 

4082 

2A0C40 

00006  PRINT 

LD 

HL ,  (DFILE) 

4085 

01DD  00 

00007 

LD 

BC ,208 

4088 

09 

00008 

ADD 

HL ,  BC 

4089 

EB 

00009 

EX 

DE  ,  HL 

408A 

218240 

0001  0 

LD 

HL ,16514 

; PRINT  MESSAGE  ON  SCREEN 

408D 

010C00 

0001  1 

LD 

BC,  1  2 

4090 

EDBO 

00012 

LDIR 

4092 

EB 

0001  3 

EX 

DE  ,HL 

4093 

011901 

0001  4 

LD 

BC ,281 

4096 

09 

00015 

ADD 

HL ,  BC 

4097 

EB 

00016 

EX 

DE  ,  HL 

4098 

011600 

0001  7 

LD 

BC  ,  2  2 

409B 

EDBO 

0001  8 

LDIR 

409D 

1  100C8 

00019  PAUSE 

LD 

DE ,51 200 

; TIMING  LOOP 

40A0 

IB 

00020  PLOOP 

DEC 

DE 

40A1 

7A 

00021 

LD 

A  ,D 

40A2 

B3 

00022 

OR 

E 

40A3 

2  OFB 

00023 

JR 

NZ , PLOOP 

40A5 

ED57 

00024  DISP 

LD 

A, I 

; DISPLAY  SCRAMBLING 

40A7 

3C 

00025 

INC 

A 

; ROUTINE 

40A8 

ED  4  7 

00026 

LD 

I, A 

40AA 

CDBB02 

00027 

CALL 

699 

; KEY  PRESS? 

40  AD 

24 

00028 

INC 

H 

4  OAE 

28F5 

"00029 

JR 

Z , DISP 

40B0 

3E1E 

00030  FIX 

LD 

A,  30 

; RETURN  TO  NORMAL 

40B2 

ED47 

00031 

LD 

I, A 

;  DISPLAY 

40B4 

CD2A0A 

00032 

CALL 

2602 

;  CLS 

40B7 

CDBB02 

00033  WAIT 

CALL 

699 

; WAIT  UNTIL  NO  KEY 

4  0BA 

24 

00034 

INC 

H 

40BB 

2  OFA 

00035 

JR 

NZ , WAIT 

40BD 

2A3440 

00036 

LD 

HL, (FRAMES) 

; POINTER  INTO  ROM 

40C0 

CBB4 

00037  RESET 

RES 

6  ,  H 

; TRIM  OFF  EXCESS  BITS 

40C2 

CBBC 

00038 

RES 

7,H 

40C4 

46 

00039  VALS 

LD 

B,  (HL) 

; RANDOM  Y  VALUE 

40C5 

23 

00040 

INC 

HL 

t 

40C6 

CBBO 

00041 

RES 

6  ,  B 

i 

40C8 

CBB8 

00042 

RES 

7,B 

4  OCA 

3E2B 

00043 

LD 

A, 43 

40CC 

B8 

00044 

CP 

B 

40CD 

38F5 

00045 

JR 

C , VALS 

; GO  BACK  IF  TOO  HIGH 

40CF 

4E 

00046 

LD 

C,  (HL) 

; RANDOM  X  VALUE 

40D0 

23 

00047 

INC 

HL 

4  GDI 

CBB 1 

00048 

RES 

6  ,  C 

40D3 

CBB9 

00049 

RES 

7,C 

40D5 

7E 

00050 

LD 

A, (HL) 

40D6 

23 

00051 

INC 

HL 

40D7 

CB47 

00052 

BIT 

0  ,  A 

40D9 

2003 

00053 

JR 

NZ  , UNPLOT 

4  ODB 

AF 

00054 

XOR 

A 

; 0  FOR  PLOT, 

40DC 

1  802 

00055 

JR 

DOPLOT 

; 1 2  8  FOR  UNPLOT 

20 


40DE 

3E80 

00056  UNPLOT 

LD 

A ,  128 

40E0 

F5 

00057  DOPLOT 

PUSH 

AF 

; SAVE  AF 

40E 1 

CD0741 

00058  PLOT 1 

CALL 

PLOT 

; PLOT  THE  POINT 

40E4 

3E2B 

00059 

LD 

A, 43 

; GET  SECOND  POINT 

40E6 

90 

00060 

SUB 

B 

40E7 

47 

00061 

LD 

B ,  A 

40E8 

FI 

00062 

POP 

AF 

40E9 

F5 

00063 

PUSH 

AF 

40EA 

CD0741 

00064  PLOT2 

CALL 

PLOT 

; PLOT  THE  POINT 

40ED 

3E3F 

00065 

LD 

A,  63 

; GET  THIRD  POINT 

4  OEF 

91 

00066 

SUB 

C 

40F0 

4F 

00067 

LD 

C ,  A 

40F 1 

F5 

00068 

PUSH 

AF 

40F2 

F 1 

00069 

POP 

AF 

40F3 

CD0741 

00070  PLOT3 

CALL 

PLOT 

; PLOT  THE  POINT 

40F6 

3E2B 

00071 

LD 

A ,  4  3 

; GET  FOURTH  POINT 

40F  8 

90 

00072 

SUB 

B 

40F9 

47 

00073 

LD 

B,A 

40  FA 

FI 

00074 

POP 

AF 

4  OFB 

CD0741 

00075  PLOT 4 

CALL 

PLOT 

; PLOT  THE  POINT 

40FE 

E5 

00076  COPY 

PUSH 

HL 

40FF 

CDBB02 

00077 

CALL 

699 

; KEY  PRESS? 

4102 

24 

00078 

INC 

H 

4103 

El 

00079 

POP 

HL 

4104 

2  8  BA 

00080 

JR 

Z , RESET 

; LOOP  IF  NOT 

4106 

C9 

00081 

RET 

; OTHERWISE  RETURN 

4107 

C5 

00082  PLOT 

PUSH 

BC 

; SUBROUTINE  TO  PLOT 

4108 

E5 

00083 

PUSH 

HL 

4109 

323040 

00084 

LD 

(  16432)  , A 

; PLOT  STATUS 

4  1  OC 

CDB20B 

00085 

CALL 

2994 

; PLOT/UNPLOT 

4  1  OF 

El 

00086 

POP 

HL 

4110 

Cl 

00087 

POP 

BC 

4111 

C9 

00088 

RET 

COPY 

40FE 

00076 

DFILE 

40  0C 

00003 

DISP 

40A5 

00024 

DOPLOT 

40E0 

00057 

FIX 

40B0 

00030 

FRAMES 

4034 

00004 

PAUSE 

409D 

00019 

PLOOP 

40A0 

00020 

PLOT 

4107 

00082 

PLOT  1 

40E1 

00058 

PLOT  2 

4  0EA 

00064 

PLOT3 

40F3 

00070 

PLOT  4 

40FB 

00075 

PRINT 

4082 

00006 

RESET 

4  0C0 

00037 

UNPLOT 

4  ODE 

00056 

VALS 

40C4 

00039 

WAIT 

40B7 

0  0  0  3  3 

00006 

00029 

00055 

00036 

00023 

00058 

00070 


00080 

00053 

00045 

00035 


00064 

00075 


21 


TS2068  PORT  ASSIGNMENTS 


CLASSIFIED  ADS: 


Timex  provided  SYNTAX  with  the 
following  chart,  referred  to  on 
page  214  of  your  2068  manual.  This 
chart  is  what  you  would  receive  if 
you  contacted  Timex  Corporation  for 
port  assignments. 


012345678 

0 

1 

2 

3 

4 

5 

6 


7  9  9 

8  6  6  6  6  A  6 

9  6  6  6  6  6 

A  6  6  6  6  6 

B  6  6  6  6  6 

C  6  6  6  6  6 

D  6  6  6  6  6 

E  6  6  6  6  6 


F666624586 

012345678 


9  A  B  C  D  E  F 

0 

1 

2 

3 

4 

5 

6 
7 


6  6  6  8 

6  6  6  9 

6  6  6  A 

6  6  6  B 

6  6  6  C 

6  6  6  D 

6  6  6  8  E 


6667713F 
9  A  B  C  D  E  F 


In  the  table,  the  vertical  borders 
show  the  most  significant  hex  digit 
and  the  horizontal  borders  show  the 
hex  digit  of  less  significance. 
Table  entries  indicate  devices  from 
the  numbered  list  that  follows. 


1.  RD 
WR 

2.  RD/WR 

3.  RD/WR 

4.  WR 

5.  RD/WR 

6. 

7. 

8. 

9. 

A.  RD/WR 


Keyboard/Cassette 
Border /Beep/Cassette 
Dock  Horizontal  Select 
Enhancement  Port 
Sound  Chip  Address 
Sound  Chip  Data 
TS2040  Printer 
Bank  Switching 
Micro-Drive 
Modem 

Centronics  Interface 


Blanks  in  the  table  indicate  ports 
available  for  use  as  of  2  Nov.  83. 


Reach  thousands  of  ZX/TS  users — for 
just  $9/line!  Send  your  typed  copy 
(35  characters  per  line)  with  check 
or  MO  to  reach  us  by  the  15th  to  be 
published  in  the  next  issue  exactly 
as  typed.  No  fractions  or  cent 
symbols.  Include  your  phone  No. 
SYNTAX  Classified, 

RD  2,  Box  457,  Harvard,  MA  01451. 

Just  300  bargains  available — order 
only  by  phone,  pay  only  by  credit 
card — The  ZX81/TS1000  Home  Computer 
Book  by  David  C.  Foyt.  Shipped  to 
you  for  $1 0+$1.5  0  P&H:  617/456-3661 

STARBURST  SOFTWARE  now  has  18  soft¬ 
ware  programs : Business, Hobby , Games , 
Educational , Utility .  Send  SASE+$1 
to:2214  Horine  Rd.,Festus,  MO  63028 

E-Z  KEY  Has  a  SPECIAL  SALE! 

TS1016  16K  RAM  $19.95  Supply 
limited-Phone  orders  only- 
(617)773-1187  Also  available  WORD 
SINC  II  $19.95  a  full  featured 
WORD  PROCESSOR  for  your  TS1000  or 
TS1500  &  TS2040  printer. 

XFORTH,  FORTH-79  FOR  16K  ZX/TS  WITH 
ONE  PASS  LOAD, FULL  THREADED  CODE,ZX 
CODE  TABLES.  SUPPORT  VIA  USER  NEWS¬ 
LETTER.  XFORTH  $25.00.  W/  F.P.  EXT 
ADD  $15.00.  ADD  $1.00  EACH  P.  &  H. 
***NEW***HAWG  WILD  "HAM  HACKER"  (TM) 
SERIES  FOR  ZX/TS  RADIO  AMATEURS**** 
MORSE  CODE  (16K)/TW0  K  CODE-BOTH  ON 

ONE  TAPE . $14.95  +  $1.00  P&H 

MINIMUF  3.5  -  16K  RADIO  PROPAGATION 
(DXERS  MUST!)  ..$17.95  +  $1.00  P&H 
CE  AMP  (FROM  SYNCWARE)  16K  CIRCUIT 
DESIGN/TEST.... $19.95  +  $1.00  P&H 
FOOTBALL  FORECASTER  NOW  AVAILABLE 
FOR  U.S.F.L..  $17.00  PLUS  $2.00  P&H 
ARK  RES  ADD  5%  TAX.  **HAWG  WILD 
SOFTWARE, BOX  7668,  LITTLE  ROCK  AR 
72217**WE  HAVE  THE  JUPITER  ACE** 


Next  month  in  SYNTAX  we'll 
discuss  the  advanced  video  modes  of 
the  TS2068.  You  can  find  some 
information  on  this  subject  in  the 
2068  manual,  appendix  C. 


"TS1 000/2 068  CANADIAN  FEDERAL  IN¬ 
COME  TAX  RETURN.  $9.95  +  1.50  P 
and  H.  Ont.  res.  add  7  pc  PST. 

JM  SOFTWARE,  1852  Appleford  St., 
Gloucester,  Ontario,  K1J  6T4" 


22 


SYNTAX  is  published  monthly  by  a  wholly- 

owned  subsidiary  of  The  Harvard  Group. 


Syntax  ZX80,  Inc. 

RD  2,  Box  457,  Harvard,  MA  01451.  Telephone 
617/456-3661. 

12  issues,  $29.  Single  issue,  $4. 


Publisher: 
Consulting  Editor: 
Technical  Consultant: 


Kirtland  H.  Olson 
Ann  L.  Zevnik 
Kirtland  H.  Olson 


©  Syntax  ZX80,  Inc.,  1984.  All  rights  reserved. 
Photocopying  prohibited.  ISSN  0273-2696 


OUR  POLICY  ON  CONTRIBUTED  MATERIAL 

SYNTAX  invites  you  to  express  opinions  related  to  any  Sinclair  computer  or 
peripheral,  or  the  newsletter.  We  will  print,  as  space  allows,  letters  discussing  items 
of  general  interest.  Of  course,  we  reserve  the  right  to  edit  letters  to  a  suitable  length 
and  to  refuse  publication  of  any  material. 

We  welcome  program  listings  for  all  levels  of  expertise  and  written  in  either 
Sinclair  BASIC  or  Z80  machine  code.  Programs  can  be  for  any  fun  or  useful 
purpose.  We  will  test  run  each  one  before  publishing  it,  but  we  will  not  debug 
programs;  please  send  only  workable  listings.  Programs  submitted  on  cassette  can  be 
tested  more  quickly  and  with  less  chance  of  error. 

In  return  for  your  listing,  we  will  pay  you  a  token  fee  of  $2.00  per  program  we 
use.  This  payment  gives  us  the  nonexclusive  right  to  use  that  program  in  any  form, 
world-wide.  This  means  you  can  still  use  it,  sell  it,  or  give  it  away,  and  so  can  we. 

We  will  consider  submissions  of  news  and  hardware  or  software  reviews.  Please 
keep  articles  short  (350-400  words).  Again,  we  reserve  the  right  to  edit  accepted 
articles  to  a  suitable  length.  We  will  pay  7  cents  per  6  characters,  including  spaces 
and  punctuation,  for  accepted  articles. 

When  you  send  in  programs  for  possible  publication  in  SYNTAX,  please 
include  the  following  information: 

•  How  to  operate  the  program,  including  what  to  input  if  it  does  not  contain 
prompts. 

•  Whether  you  can  run  the  program  over  again  and  how. 

•  How  to  exit  the  program. 

•  The  Syntactic  Sum  (program  published  in  Feb.  81  and  Jun.  81;  send  SASE 
for  a  free  copy). 

•  What  RAM  size  program  requires. 

•  What  ROM  program  uses. 

We  pay  for  this  explanatory  text  at  the  same  rate  as  for  articles  in  addition  to 
payment  for  the  program  itself. 

If  you  want  us  to  return  your  original  program  listing  or  article,  please  include 
a  self-addressed,  stamped  envelope.  Otherwise,  we  cannot  return  submitted  material. 


16K*  *  *  *  *  CAVE  MAZE  *  *  *  *  *16K 
Fast  action  3D  Maze.  MC  display 
Never  the  same.  Only  $7.00  P.P. 
Doc's  Software  4339  Keysville  Ave. 
Spring  Hill,  Fla.  33526 

HOW  TO  MARKET  YOUR  T/S  SOFTWARE 
Turn  your  program  into  profits  with 
this  comprehensive  guide  -  pricing, 
advertising,  publishing,  royalties, 
market  trends,  plus  many  references 
$14.95  VISA,  MC,  MO,  check 
SOFTMARK  ASSOCIATES,  DEPT  SX2 

210  Fifth  Ave,  New  York,  NY  10010 

*****  LEARN  ASSEMBLER  EASILY  ***** 

*  Machine  code  doesn't  load?  * 

*  Find  textbooks  confusing?  * 
***********  ZX81  -  16K  *********** 
Loader/saver  program  on  cassette 
with  instructions  and  intro  booklet 
$14.95  (CA  add  6%)  +  $1.00  P&H  CK/MO 

ORANGE  COAST  SOFTWARE  CORPORATION 
PO  Box  951,  Midway  City,  Ca.  92655 

16K  PERSONAL  FINANCE  PROGRAM  TAPES 
****RETURN  ON  INVESTMENT**** 
Evaluate  stocks,  real  estate,  money 
funds,  savings,  etc.  Rate  of  return 
&  Gain/Loss.  Compare  investments. 

******INCOME  PORTFOLIO****** 
Monthly  &  annual  record  &  graphics. 
Excellent  income  tax  data  record. 
**Self  prompting  &  Printer  copies** 
$14.95  each,  $24.95  both.  Check  or 
money  order.  RAE,  604  Danley  Drive, 
Fort  Myers,  FL  33907 


Fill  out  the  coupon  below  and  mail  it  to:  SYNTAX  RD2  Box  457,  Harvard,  MA  01451 


sl/84 


□  My  check  is  enclosed.  □  Please  charge  my  □  VISA 

Make  checks  payable  to:  □  Diners  Club  D  American 

SYNTAX  ZX80.  Inc  Express  □  Mastercard 

□  Carte  Blanche  account 

Account  number 


YES!  Please  send  me: 

□  The  Combination  II  (13  issues  of  SYNTAX  and  SQ  Winter 

82-Summer  83) . $39 

□  The  Catch-up  II  (SYNTAX  Jan.  82 -Jan.  84,  SQ  Winter  82- 

Summer  83,  plus  1  binder)  . $77 


Exp.  date _ Bank  number  (MC  only)  _ 

Signature  _ _ _ _ 

Name _ 

Address  _ _ _ 

City _ State  _ Zip _ 

Day  phone  (  )  _ Evening  phone  (  ) 

□  My  subscription  number  is: _ 

□  This  is  a  new  subscription 


□  The  Works  II  (SYNTAX  No.  80-Dec.  83,  SQ  Winter  82- 

Summer  83,  plus  2  binders) . $97 

□  12  issues  of  SYNTAX . $29 

□  3  issues  Syntax  Quarterly  (Winter  82 -Summer  83) . $25 

□  1  issue  Syntax  Quarterly  □  Winter  82  □  Spring  83 

□  Summer  83 . $9 

□  1  Binder . $9  □  1  issue  of  SYNTAX . $4 

Telephone  orders  call 

617-456-3661 

These  offers  expire  3/31/ 84  — SUBSCRIBE  NOW. 


23 


LAND  SURVEYING  PROGRAMS:  Prog.No. 
l -,,COORDlNATES"-computes  survey 
coordinates , area  of  any  configura¬ 
tion;  incl  .  inverse  mode.  Prog. No. 2- 
"VERTICAL  CURVE "-computes  Vert. 
Curve  data  in  tabular  form,  inc. 
Tan. &Vert .Curve  Elev.,Low  Pt.,High 
Pt .Sta . &  Elev.  $14.95  for  each  prog 
chk/MO  to  Paul  F.  Seymour,  P.E., 


P.O.  Box  11,  Hamburg,  N.J.  07419. 


TS  USER,  the  full  and  candid  news¬ 
letter  is  now  16  pages  a  month 
with  no  ads.  All  of  volume  2  is 
available  for  $10.95.  Get  a  manual 
on  office  automation  with  your 
Timex.  Subscribe  now  to  avoid  a 
March  1st  price  increase.  Send  a 
check  or  M/0  for  $16.95  for  12 
issues  to:  YAGSEE  PUBLISHING,  POB 
155,  VICKSBURG,  MI,  49097.  Save 
yourself  hours  and  dollars  by  sub¬ 
scribing  now  to  the  largest  sell¬ 
ing  unsponsored  Timex-related  pub¬ 
lication  in  the  Universe!! I !!!!!! ! 
Sample  issue  $2.95.  Write  now  to 
see  who  had  most  material  in  1983. 


DO  SOMETHING  USEFUL  WITH  A  COMPUTER 
Useful  software  with  useful  manuals 
(16k  ZX  &  T/S).  How  to  use  it,  how 

it  works,  how  to  modify  it . 

Menu  driven,  just  load  and  go!!!!!! 
SEND  FOR  CATALOG. .Kendric  C.  Smith, 


927  Mears  Court,  Stanford,  CA  94305 


H\RV\RD 

GROU-* 


Bolton  Road,  Harvard,  Mass.  01451 


MR  WILLIAM  TOMLINSON 
3635  RIVEREDGE  OR. 
JACKSONVILLE  FL 


NEW  RELEASE 

Now  you  can  translate  your  BASIC 
programs  from  your  TS1000  tapes 
to  TS2000  tapes.  This  program 
UPLOAD  2000  will  do  this  for  you. 

All  available  TS  products  sold 

UPL0AD2  000  - $19.95 

Blank  C10  Data  tapes  $9.95/10  Tapes 
You  can  purchase  these  items 
from  E-Z  KEY,  Suite  75-STXA,  711 
Southern  Artery,  Quincy,  MA. 

02169  (617)773-1187  MC  or  VISA 

PRINTERS  $49.90  — 30  Mindware  MW100 
available.  Prints  all  symbols  for 
TS1000/1500,  three  modes,  16  col., 
ribbon  on  plain  paper.  Solves  power 
and  extender  problems.  Pyramid  Elec 
2174  Gulf  Gate,  Sarasota,  FL  33581. 
COD,  Visa,  MC.  Ph.  (813)  922-9574. 

CRYPTOGRAPHY  SOFTWARE  for  T/S-1000S 
w/2K  or  more.  For  cryptosecure  re¬ 
cords,  communication?  also  fun  and 
learning.  Instructions,  descrip¬ 
tion  and  listing .  $5.95 

DEL  PRODUCTS,  INC.,  13512  Keating 
St.,  Rockville,  MD  20853 

CRYSTAL  COAST  SOFTWARE.  Educational 
Entertaining  and  Practical  Programs 
Send  for  FREE  catalog: 

PO  BOX  233,  MOREHEAD  CITY,  NC  28557 


U.S.  Postage 
PAID 

Harvard,  MA 
Permit  No. 8 
01451 


First  Class 


05 8S XU 68  J 
U